t tumours were labelled by M in the class label x$class,

ant=x$radius[which(x$class=='M')]

n(malignant)

sd(malignant)

m(sort(malignant),mean=mu,sd=sigma)

alignant,nclass=50,prob=TRUE)

sort(malignant),y)

y was a y-coordinate vector representing a density function

d using the dnorm function. The histogram approach was used at

enerate a density function with the prob parameter switched on.

mooth density curve was added using the parametric density

n approach. Figure 2.8 shows the densities of the malignant

adius and the benign tumour radius estimated using the above

(a) (b)

he densities of two types of tumours estimated using the parametric approach

our radius feature of the breast cancer data. (a) The malignant tumour density.

nign tumour density.

the dnorm function for the parametric density estimation is

assumption that a data set follows a Gaussian distribution. The

rval of a Gaussian distribution is between −∞ and ∞ comprising

umbers. In fact, some feature of this breast cancer data will not

ve such as the tumour area. In order to estimate a better density

a feature, the Gamma distribution can be used. The R function for

g a Gamma density function for a data set is dgamma. The format